import request from '@/utils/request'

// 创建表单详情
export function createFormData(data) {
  return request({
    url: '/bpm/form-data/create',
    method: 'post',
    data: data
  })
}

// 创建多条表单详情
export function createMutiFormData(data) {
  return request({
    url: '/bpm/form-data/createMuti',
    method: 'post',
    data: data
  })
}

// 更新表单详情
export function updateFormData(data) {
  return request({
    url: '/bpm/form-data/update',
    method: 'put',
    data: data
  })
}

// 更新多条表单详情
export function updateMutiFormData(data) {
  return request({
    url: '/bpm/form-data/updateMuti',
    method: 'put',
    data: data
  })
}

// 通过id删除表单详情
export function deleteFormData(id) {
  return request({
    url: '/bpm/form-data/delete?id=' + id,
    method: 'delete'
  })
}

// 通过表单标识删除表单详情
export function deleteBfdFormData(data) {
  return request({
    url: '/bpm/form-data/deleteByFormdef?formDef=' + data,
    method: 'delete'
  })
}

// 获得表单详情
export function getFormData(id) {
  return request({
    url: '/bpm/form-data/get?id=' + id,
    method: 'get'
  })
}

// 获得表单详情列表
export function getFormDataList(query) {
  return request({
    url: '/bpm/form-data/listByFormDef',
    method: 'get',
    params: query
  })
}

// 获得表单详情分页
export function getFormDataPage(query) {
  return request({
    url: '/bpm/form-data/page',
    method: 'get',
    params: query
  })
}

// 导出表单详情 Excel
export function exportFormDataExcel(query) {
  return request({
    url: '/bpm/form-data/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
